<?php
/**
 * Author: Administrator
 * Date: 2022/8/3 1:54
 */

namespace DesignPatterns\Behavioral\Strategy;

class IdComparator implements ComparatorInterface
{

    public function compare($a, $b): int
    {
        $a = $a['id'];
        $b = $b['id'];
        return $a==$b ? 0 : ($a > $b ? 1 : -1);
    }
}